Coding of information about transform kernel set

ABSTRACT

An image decoding method includes: acquiring a multiple transform selection (MTS) index and residual information from a bitstream; deriving transform coefficients for the current block on the basis of the residual information; and generating residual samples of the current block on the basis of the MTS index and the transform coefficients, wherein the MTS index indicates a transform kernel set to be applied to the current block among transform kernel set candidates, at least one bin among bins of a bin string of the MTS index is derived on the basis of context coding, the context coding is performed on the basis of values of increase and decrease in a context index pertaining to the MTS index, and a single value of increase and decrease in the context index can be used for the context coding of the first bin among the bins of the bin string.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.17/556,099, filed on Dec. 20, 2021, which is a continuation pursuant to35 U.S.C. § 119(e) of International Application PCT/KR2020/007599, withan international filing date of Jun. 11, 2020, which claims the benefitof U.S. Provisional Patent Application No. 62/863,812, filed on Jun. 19,2019, the contents of which are hereby incorporated by reference hereinin their entirety.

BACKGROUND OF THE DISCLOSURE Field of the disclosure

The present disclosure relates to an image coding technology, and moreparticularly, to the coding of information about a transform kernel set.

Related Art

Recently, the demand for high resolution, high quality image/video suchas 4K, 8K or more Ultra High Definition (UHD) image/video is increasingin various fields. As the image/video resolution or quality becomeshigher, relatively more amount of information or bits are transmittedthan for conventional image/video data Therefore, if image/video dataare transmitted via a medium such as an existing wired/wirelessbroadband line or stored in a legacy storage medium, costs fortransmission and storage are readily increased.

Moreover, interests and demand are growing for virtual reality (VR) andartificial reality (AR) contents, and immersive media such as hologram;and broadcasting of images/videos exhibiting image/video characteristicsdifferent from those of an actual image/video, such as gameimages/videos, are also growing.

Therefore, a highly efficient image/video compression technique isrequired to effectively compress and transmit, store, or play highresolution, high quality images/videos showing various characteristicsas described above.

SUMMARY

According to an embodiment of the present document, a method and anapparatus for enhancing image/video coding efficiency are provided.

According to an embodiment of the present document, a method and anapparatus for coding an MTS index in video coding are provided.

According to an embodiment of the present document, a method and anapparatus for signaling MTS index information are provided.

According to an embodiment of the present document, a method and anapparatus for signaling information representing a transform kernel setto be applied to a current block among a plurality of transform kernelsets are provided.

According to an embodiment of the present document, a method and anapparatus for context coding or bypass coding with respect to bins foran MTS index are provided.

According to an embodiment of the present document, a video/imagedecoding method performed by a decoding apparatus is provided.

According to an embodiment of the present document, a decoding apparatusfor performing videolimage decoding is provided.

According to an embodiment of the present document, a video/imageencoding method performed by an encoding apparatus is provided.

According to an embodiment of the present document, an encodingapparatus for performing video/image encoding is provided.

According to an embodiment of the present document, a computer-readabledigital storage medium storing encoded video/image information generatedaccording to the video/image encoding method disclosed in at least oneof the embodiments of this document is provided.

According to an embodiment of the present document, a computer-readabledigital storage medium storing encoded information or encodedvideo/image information causing a. decoding apparatus to perform thevideo/image decoding method disclosed in at least one of the embodimentsof this document is provided.

According to the present document, the overall image/video compressionefficiency can be enhanced.

According to the present document, the MTS index information can beefficiently signaled.

According to the present document, complexity of the coding system canbe lowered by efficiently coding the MTS index information.

Effects that can be obtained through a detailed example of the presentdocument are not limited to the effects enumerated above. For example,there may be various technical effects that can be understood or inducedby a person having ordinary skill in the related art from the presentdocument. Accordingly, the detailed effects of the present document arenot limited to those explicitly stated in the present document, but mayinclude various effects that can be understood or induced from thetechnical features of the present document.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 schematically illustrates an example of a video/image codingsystem to which the present document is applicable.

FIG. 2 is a diagram schematically explaining the configuration of avideo/image encoding apparatus to which the present document isapplicable.

FIG. 3 is a diagram schematically explaining the configuration of avideo/image; decoding apparatus to which the present document isapplicable.

FIG. 4 schematically illustrates a multi-transform technique accordingto an embodiment of the present document.

FIG. 5 exemplarily illustrates intra directional modes in 65 predictiondirections.

FIGS. 6 and 7 are diagrams explaining RST according to an embodiment ofthe present document.

FIG. 8 exemplarily illustrates context-adaptive binary arithmetic coding(CABAL) for encoding syntax elements.

FIGS. 9 and 10 schematically illustrate a video/image encoding methodand an example of related components according to embodiment(s) of thepresent document.

FIGS. 11 and 12 schematically illustrate a video/image decoding methodand an example of related components according to embodiment(s) of thepresent document.

FIG. 13 illustrates an example of a content streaming system to whichembodiments disclosed in the present document are applicable.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

The present disclosure may be modified in various forms, and specificembodiments thereof will be described and illustrated in the drawings.However, the embodiments are not intended for limiting the disclosure.The terms used in the following description are used to merely describespecific embodiments, but are not intended to limit the disclosure. Anexpression of a singular number includes an expression of the pluralnumber, so long as it is clearly read differently. The terms such as“include” and “have” are intended to indicate that features, numbers,steps, operations, elements, components, or combinations thereof used inthe following description exist and it should be thus understood thatthe possibility of existence or addition of one or more differentfeatures, numbers, steps, operations, elements, components, orcombinations thereof is not excluded.

In addition, each configuration of the drawings described in thisdocument is an independent illustration for explaining functions asfeatures that are different from each other, and does not mean that eachconfiguration is implemented by mutually different hardware or differentsoftware. For example, two or more of the configurations can be combinedto form one configuration, and one configuration can also be dividedinto multiple configurations. Without departing from the gist of thisdocument, embodiments in which configurations are combined and/orseparated are included in the scope of claims.

Hereinafter, examples of the present embodiment will be described indetail with reference to the accompanying drawings. In addition, likereference numerals are used to indicate like elements throughout thedrawings, and the same descriptions on the like elements will beomitted.

This document relates to video/image coding. For example,methods/embodiments disclosed in this document may be related to theversatile video coding (V VC) standard (ITU-T Rec. H.266), thenext-generation video/image coding standard after VVC, or other videocoding related standards (e.g., high efficiency video coding (HEVC)standard (ITU-T Rec. H.265), essential video coding (EVC) standard, AVS2standard, and the like).

This document suggests various embodiments of video/image coding, andthe above embodiments may also be performed in combination with eachother unless otherwise specified.

In this document, a video may refer to a series of images over time. Apicture generally refers to the unit representing one image at aparticular time frame, and a slice/tile refers to the unit constitutinga part of the picture in terms of coding. A slice/tile may include oneor more coding tree units (CTUs). One picture may consist of one or moreslices/tiles. One picture may consist of one or more tile groups. Onetile group may include one or more tiles.

A pixel or a pel may mean a smallest unit constituting one picture (orimage). Also, ‘sample’ may be used as a term corresponding to a pixel. Asample may generally represent a pixel or a value of a pixel, and mayrepresent only a pixel/pixel value of a luma component or only apixel/pixel value ofa chroma component.

A unit may represent a basic unit of image processing. The unit mayinclude at least one of a specific region of the picture and informationrelated to the region. One unit may include one luma block and twochroma (ex. cb, cr) blocks. The unit may be used interchangeably withterms such as block or area in some cases. In a general case, an MxNblock may include samples (or sample arrays) or a set (or array) oftransform coefficients of M columns and N rows. Alternatively, thesample may mean a pixel value in the spatial domain, and when such apixel value is transformed to the frequency domain, it may mean atransform coefficient in the frequency domain.

In this document, the term “/” and “,” should be interpreted to indicate“and/or.” For instance, the expression “A/B” may mean “A and/or B.”Further, B″ may mean “A and/or B.” Further, “A′B/C” may mean “at leastone of A, B, and/or C.” Also, “A/B/C” may mean “at least one of A, B,and/or C.”

Further, in the document, the term “of”p9 should be interpreted toindicate “and/or.” For instance, the expression “A or B” may comprise 1)only A, 2) only B, and/or 3) both A and B. In other words, the term “or”in this document should be interpreted to indicate “additionally oralternatively.”1411 In the present specification, “at least one of A andB” may mean “only A”, “only B”, or “both A and B”. Further, in thepresent specification, the expression “at least one of A or B” or “atleast one of A and/or B” may be interpreted the same as “at least one ofA and B”.

Further, in the present specification, “at least one of A, B and C” maymean “only A”. “only B”, “only C”, or “any combination of A, B and C”.Further, “at least one of A, B or C” or “at least one of A, B and/or C”may mean “at least one of A, B and C”.

Further, the parentheses used in the present specification may mean “forexample”. Specifically, in the case that “prediction (intra prediction)”is expressed, it may be indicated that “intra prediction” is proposed asan example of “prediction”. In other words, the term “prediction” in thepresent specification is not limited to “intra prediction”, and it maybe indicated that “intra prediction” is proposed as an example of“prediction”. Further, even in the case that “prediction (i.e., intra.prediction)” is expressed, it may be indicated that “intra prediction”is proposed as an example of “prediction”.

In the present specification, technical features individually explainedin one drawing may be individually implemented, or may be simultaneouslyimplemented.

FIG. 1 illustrates an example of a video/image coding system to whichthe disclosure of the present document may be applied.

Referring to FIG I, a video/image coding system may include a sourcedevice and a reception device. The source device may transmit encodedVideo/image: information or data to the reception device through adigital storage medium or network in the form of a file or streaming.

The source device may include a video source, an encoding apparatus, anda transmitter. The receiving device may include a receiver, a decodingapparatus, and a renderer. The encoding apparatus may be called avideo/image encoding apparatus, and the decoding apparatus may be calleda video/image decoding apparatus. The transmitter may be included in theencoding apparatus. The receiver may be included in the decodingapparatus. The renderer may include a display, and the display may beconfigured as a separate device or an external component

The video source may acquire video image through a process of capturing,synthesizing, or generating the video/image. The video source mayinclude a video/image capture device and/or a video/image generatingdevice. The video/image capture device may include, for example, one ormore cameras, video/image archives including previously capturedvideo/images, and the like. The video/image generating device mayinclude, for example, computers, tablets and smartphones, and may(electronically) generate video/images. For example, a virtualvideo/image may be generated through a computer or the like. In thiscase, the video/image capturing process may be replaced by a process ofgenerating related data.

The encoding apparatus may encode input video/image. The encodingapparatus may perform a series of procedures such as prediction,transform, and quantization for compaction and coding efficiency. Theencoded data (encoded video/image information) may be output in the formof a bitstream.

The transmitter may transmit the encoded image/image information or dataoutput in the form of a bitstream to the receiver of the receivingdevice through a digital storage medium or a network in the form of afile or streaming. The digital storage medium may include variousstorage mediums such as USB, SD, CD, MD, Biu-ray, HDD, SSD, and thelike. The transmitter may include an element for generating a media filethrough a predetermined file format and may include an element fortransmission through a broadcast/communication network. The receiver mayreceive/extract the bitstream and transmit the received bitstream to thedecoding apparatus.

The decoding apparatus may decode the video/image by performing a seriesof procedures such as dequantization, inverse transform, and predictioncorresponding to the operation of the encoding apparatus.

The renderer may render the decoded video/image. The renderedvideo/image may be displayed through the display.

FIG. 2 is a diagram schematically illustrating the configuration of avideo/image encoding apparatus to which the disclosure of the presentdocument may be applied. Hereinafter, what is referred to as the videoencoding apparatus may include an image encoding apparatus.

Referring to FIG. 2 , the encoding apparatus 200 may include and beconfigured with an image partitioner 210, a predictor 220, a residualprocessor 230, an entropy encoder 240, an adder 250, a filter 260, and amemory 270. The predictor 220 may include an inter predictor 221 and anintra predictor 222. The residual processor 230 may include atransformer 232, a quantizer 233, a dequantizer 234, and an inversetransformer 235. The residual processor 230 may further include asubtra.ctor 231. The adder 250 may be called a reconstructor orreconstructed block generator. The image partitioner 210, the predictor220, the residual processor 230, the entropy encoder 240, the adder 250,and the filter 260, which have been described above, may be configuredby one or more hardware components (e.g., encoder chipsets orprocessors) according to an embodiment. In addition, the memory 270 mayinclude a decoded picture buffer (DPB), and may be configured by adigital storage medium. The hardware component may further include thememory 270 as an internal/external component.

The image partitioner 210 may split an input image (or, picture, frame)input to the encoding apparatus 200 into one or more processing units.As an example, the processing unit may be called a coding unit (CU). Inthis case, the coding unit may be recursively split according to aQuad-tree binary-tree ternary-tree (QTBTIT) structure from a coding treeunit (CTU) or the largest coding unit (LCU). For example, one codingunit may be split into a. plurality of coding units of a deeper depthbased on a quad-tree structure, a binary--tree structure, and/or aternary-tree structure. In this case, for example, the quad-treestructure is first applied and the binary-tree structure and/or theternary-tree structure may be later applied. Alternatively, thebinary-tree structure may also be first applied. A coding procedureaccording to the present disclosure may be performed based on a finalcoding unit which is not split any more. In this case, based on codingefficiency according to image chara.cteri sties or the like, the maximumcoding unit may be directly used as the final coding unit, or asnecessary, the coding unit may be recursively split into coding units ofa deeper depth, such that a coding unit having an optimal size may beused as the final codinu unit. Here, the coding procedure may include a.

procedure such as prediction, transform, and reconstruction to bedescribed later. As another example, the processing unit may furtherinclude a prediction unit (PU) or a transform unit (TU). In this case,each of the prediction unit and the transform unit may be split orpartitioned from the aforementioned final coding unit. The predictionunit may be a unit of sample prediction, and the transform unit may be aunit for inducing a transform coefficient and/or a unit for inducing aresidual signal from the transform coefficient.

The unit may be interchangeably used with the term such as a block or anarea in some cases. Generally, an MxN block may represent samplescomposed of M columns and N rows or a group of transform coefficients.The sample may generally represent a pixel or a value of the pixel, andmay also represent only the pixel/pixel value of a luma component, andalso represent only the pixel/pixel value of a chroma component. Thesample may be used as the term corresponding to a pixel or a pealconfiguring one picture (or image).

The subtractor 231 may generate a residual signal (residual block,residual samples, or residual sample array) by subtracting a predictionsignal (predicted block, prediction samples, or prediction sample array)output from the predictor 220 from an input image signal (originalblock, original samples, or original sample array), and the generatedresidual signal is transmitted to the transformer 232. The predictor 220may perform prediction for a processing target block (hereinafter,referred to as a “current block”), and generate a predicted blockincluding prediction samples for the current block. The predictor 220may determine whether intra prediction or inter prediction is applied ona current block or in a CU unit. As described later in the descriptionof each prediction mode, the predictor may generate various kinds ofinformation related to prediction, such as prediction mode information,and transfer the generated information to the entropy encoder 240. Theinformation on the prediction may be encoded in the entropy encoder 240and output in the form of a bitstream.

The intra predictor 222 may predict a current block with reference tosamples within a current picture. The referenced samples may be locatedneighboring to the current block, or may also be located away from thecurrent block according to the prediction mode. The prediction modes inthe intra prediction may include a plurality of non-directional modesand a plurality of directional modes. The non-directional mode mayinclude, for example, a DC mode or a planar mode. The directional modemay include, for example, 33 directional prediction modes or 65directional prediction modes according to the fine degree of theprediction direction. However, this is illustrative and the directionalprediction modes which are more or less than the above number may beused according to the setting. The intra predictor 222 may alsodetermine the prediction mode applied to the current block using theprediction mode applied to the neighboring block.

The inter predictor 221 may induce a predicted block of the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. At this time, in order to decreasethe amount of motion information transmitted in the inter predictionmode, the motion information may be predicted in units of a block, asub-block, or a sample based on the correlation of the motioninformation between the neighboring block and the current block. Themotion information may include a motion vector and a reference pictureindex. The motion information may further include inter predictiondirection (L0 prediction, L1 prediction. Bi prediction, or the like)information. In the case of the inter prediction, the neighboring blockmay include a spatial neighboring block existing within the currentpicture and a temporal neighboring block existing in the referencepicture. The reference picture including the reference block and thereference picture including the temporal neighboring block may also bethe same as each other, and may also be different from each other. Thetemporal neighboring block may be called the name such as a collocatedreference block, a collocated CU (colCU), or the like, and the referencepicture including the temporal neighboring block may also be called acollocated picture (colPic). For example, the inter predictor 221 mayconfigure a motion information candidate list based on the neighboringblocks, and generate information indicating what candidate is used toderive the motion vector and/or the reference picture index of thecurrent block. The inter prediction may be performed based on variousprediction modes, and for example, in the case of a skip mode and amerge mode, the inter predictor 221 may use the motion information ofthe neighboring block as the motion information of the current block. Inthe case otthe skip mode, the residual signal may not be transmittedunlike the merge mode. A motion vector prediction (MVP) mode mayindicate the motion vector of the current block by using the motionvector of the neighboring block as a motion vector predictor, andsignaling a motion vector difference.

The predictor 220 may generate a prediction signal based on variousprediction methods described below. For example, the predictor may notonly apply intra prediction or inter prediction to predict one block butalso simultaneously apply both intra prediction and inter prediction.This may be called combined inter and intra prediction (CIIP). Inaddition, the predictor may perform an intra block copy (IBC) forprediction of a block. The intra block copy may be used for contentimage/moving image coding of a game or the like, for example, screencontent coding (SCC). The IBC basically performs prediction in thecurrent picture, but may be performed similarly to inter prediction inthat a reference block is derived in the current picture. That is, theIBC may use at least one of inter prediction techniques described in thepresent document.

The prediction signal generated through the inter predictor 221 and/orthe intra predictor 222 may be used to generate a reconstructed signalor to generate a residual signal. The transformer 232 may generatetransform coefficients by applying a transform technique to the residualsignal, For example, the transform technique may include at least one ofa discrete cosine transform (DCT), a discrete sine transform (DST), agraph-based transform (GBT), or a conditionally non-linear transform(CNT). Here, the GBT means transform obtained from a graph whenrelationship information between pixels is represented by the graph. TheCNT refers to the transform obtained based on a prediction signalgenerated using all previously reconstructed pixels. In addition, thetransform process may be applied to square pixel blocks having the samesize, or may be applied to blocks having a variable size rather than asquare.

The quantizer 233 may quantize the transform coefficients and transmitthem to the entropy encoder 240, and the entropy encoder 240 may encodethe quantized signal (information on the quantized transformcoefficients) and output a bitstream. The information on the quantizedtransform coefficients may be referred to as residual information. Thequantizer 233 may rearrange block type quantized transform coefficientsinto a one-dimensional vector form based on a coefficient scanningorder, and generate information on the quantized transform coefficientsbased on the quantized transform coefficients in the one-dimensionalvector form. The entropy encoder 240 may perform various encodingmethods such as, for example, exponential Golomb, context-adaptivevariable length coding (CAVLC), context-adaptive binary arithmeticcoding (CABAC), and the like. The entropy encoder 240 may encodeinformation necessary for video/image reconstruction together with orseparately from the quantized transform coefficients (e.g., values ofsyntax elements and the like). Encoded information (e.g., encodedvideo/image information) may be transmitted or stored in the unit of anetwork abstraction layer (NAL) in the form of a bitstream. Thevideo/image information may further include information on variousparameter sets, such as an adaptation parameter set (APS), a pictureparameter set (PPS), a sequence parameter set (SPS), or a videoparameter set (VPS). In addition, the videolimage information mayfurther include general constraint information. In the present document,information and/or syntax elements being signaled/transmitted to bedescribed later may be encoded through the above-described encodingprocedure, and be included in the bitstream. The bitstream may betransmitted through a network, or may be stored in a digital storagemedium. Here, the network may include a broadcasting network and/or acommunication network, and the digital storage medium may includevarious storage media, such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, andthe like. A transmitter (not illustrated) transmitting a signal outputfrom the entropy encoder 240 and/or a storage unit (not illustrated)storing the signal may be configured as an internal/external element ofthe encoding apparatus 200, and alternatively, the transmitter may beincluded in the entropy encoder 240.

The quantized transform coefficients output from the quantizer 233 maybe used to generate a prediction signal. For example, the residualsignal (residual block or residual samples) may be reconstructed byapplying dequantization and inverse transform to the quantized transformcoefficients through the dequantizer 234 and the inverse transformer235. The adder 250 adds the reconstructed residual signal to theprediction signal output from the predictor 220 to generate areconstructed signal (reconstructed picture, reconstructed block,reconstructed samples, or reconstructed sample array). If there is noresidual for the processing target block, such as a case that a skipmode is applied, the predicted block may be used as the reconstructedblock. The generated reconstructed signal may be used for intraprediction of a next processing target block in the current picture, andmay be used for inter prediction of a next picture through filtering asdescribed below,

Meanwhile, luma mapping with chroma scalingscaling (LMCS) may be appliedduring a picture encoding and/or reconstruction process.

The filter 260 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter260 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture, and store the modifiedreconstructed picture in the memory 270, specifically, in a DPB of thememory 270. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset (SAO), an adaptive loopfilter, a bilateral filter, and the like. The filter 260 may generatevarious kinds of information related to the filtering, and transfer thegenerated information to the entropy encoder 290 as described later inthe description of each filtering method. The information related to thefiltering may be encoded by the entropy encoder 290 and output in theform of a bitstream. The modified reconstructed picture transmitted tothe memory 270 may be used as a. eference picture in the inter predictor221. When the inter prediction is applied through the encodingapparatus, prediction mismatch between the encoding apparatus 200 andthe decoding apparatus can be avoided and encoding efficiency can beimproved.

The DPB of the memory 270 may store the modified reconstructed picturefor use as the reference picture in the inter predictor 221. The memory270 may store motion information of a block from which the motioninformation in the current picture is derived (or encoded) andlor motioninformation of blocks in the picture, having already been reconstructed.The stored motion information may be transferred to the inter predictor221 to be utilized as motion information of the spatial neighboringblock or motion information of the temporal neighboring block. Thememory 270 may store reconstructed samples of reconstructed blocks inthe current picture, and may transfer the reconstructed samples to theintra predictor 222.

FIG. 3 is a diagram for schematically explaining the configuration of avideo/image decoding apparatus to which the disclosure of the presentdocument may be applied.

Referring to FIG. 3 , the decoding apparatus 300 may include andconfigured with an entropy decoder 310, a residual processor 320, apredictor 330, an adder 340, a filter 350, and a memory 360. Thepredictor 330 may include an inter predictor 331 and an intra predictor332.

The residual processor 320 may include a dequantizer 321 and an inversetransformer 322. The entropy decoder 310, the residual processor 320,the predictor 330, the adder 340, and the filter 350, which have beendescribed above, may be configured by one or more hardware components(e.g., decoder chipsets or processors) according to an embodiment.Further, the memory 360 may include a decoded picture buffer (DFB), andmay be configured by a digital storage medium. The hardware componentmay further include the memory 360 as an internal/external component.1701 When the bitstream including the video/image information is input,the decoding apparatus 300 may reconstruct the image in response to aprocess in which the video/image information is processed in theencoding apparatus illustrated in FIG. 2 . For example, the decodingapparatus 300 may derive the units/blocks based on block split-relatedinformation acquired from the bitstream. The decoding apparatus 300 mayperform decoding using the processing unit applied to the encodingapparatus. Therefore, the processing unit for the decoding may be, forexample, a. coding unit, and the coding unit may be split according tothe quad-tree structure, the binary-tree structure, and/or theternary-tree structure from the coding tree unit or the maximum codingunit. One or more transform units may be derived from the coding unit.In addition, the reconstructed image signal decoded and output throughthe decoding apparatus 300 may be reproduced through a reproducingapparatus.

The decoding apparatus 300 may receive a signal output from the encodingapparatus of FIG. 2 in the form of a bitstream, and the received signalmay be decoded through the entropy decoder 310. For example, the entropydecoder 310 may parse the bitstream to derive information (e.g.,video/image: information) necessary for image reconstruction (or picturereconstruction). The video/image information may further includeinformation on various parameter sets such as an adaptation parameterset (APS), a picture parameter set (PPS), a sequence parameter set(SPS), or a video parameter set (VPS). In addition, the video/imageinformation may further include general constraint information. Thedecoding apparatus may further decode picture based on the informationon the parameter set and/or the general constraint information.Signaled/received information and/or syntax elements described later inthis document may be decoded may decode the decoding procedure andobtained from the bitstream. For example, the entropy decoder 310decodes the information in the bitstream based on a coding method suchas exponential Golomb coding, CAVLC, or CABAC, and output syntaxelements required for image reconstruction and quantized values oftransform coefficients for residual. More specifically, the CABACentropy decoding method may receive a bin corresponding to each syntaxelement in the bitstream, determine a context model by using a decodingtarget syntax element information, decoding information of a decodingtarget block or information of a symbol/bin decoded in a previous stage,and perform an arithmetic decoding on the bin by predicting aprobability of occurrence of a bin according to the determined contextmodel, and generate a symbol corresponding to the value of each syntaxelement. In this case, the CABAC entropy decoding method may update thecontext model by using the information of the decoded symbol/bin for acontext model of a next symbol/bin after determining the context model.The information related to the prediction among the information decodedby the entropy decoder 310 may be provided to the predictor 330, andinformation on the residual on which the entropy decoding has beenperformed in the entropy decoder 310, that is, the quantized transformcoefficients and related parameter information, may be input to thedequantizer 321. In addition, information on filtering among informationdecoded by the entropy decoder 310 may be provided to the filter 350.Meanwhile, a receiver (not illustrated) for receiving a signal outputfrom the encoding apparatus may be further configured as aninternal/external element of the decoding apparatus 300, or the receivermay be a constituent element of the entropy decoder 310. Meanwhile, thedecoding apparatus according to the present document may be referred toas a video/image/picture decoding apparatus, and the decoding apparatusmay be classified into an information decoder (video/image/pictureinformation decoder) and a sample decoder (video/image/picture sampledecoder). The information decoder may include the entropy decoder 310,and the sample decoder may include at least one of the dequantizer 321,the inverse transformer 322, the predictor 330, the adder 340, thefilter 350, and the memory 360.

The dequantizer 321 may dequantize the quantized transform coefficientsto output the transform coefficients. The dequantizer 321 may rearrangethe quantized transform coefficients in a two-dimensional block form. Inthis case, the rearrangement may be performed based on a coefficientscan order performed by the encoding apparatus. The dequantizer 321 mayperform dequantization for the quantized transform coefficients using aquantization parameter (e.g., quantization step size information), andacquire the transform coefficients.

The inverse transformer 322 inversely transforms the transformcoefficients to acquire the residual signal (residual block, residualsample array).

The predictor 330 may perform the prediction of the current block, andgenerate a predicted block including the prediction samples of thecurrent block. The predictor may determine whether the intra predictionis applied or the inter prediction is applied to the current block basedon the information about prediction output from the entropy decoder 310,and determine a specific intra/inter prediction mode.

The predictor may generate a prediction signal based on variousprediction methods described below. For example, the predictor may notonly apply intra prediction or inter prediction to predict one block butalso simultaneously apply intra prediction and inter prediction. Thismay be called combined inter and intra prediction (CLIP). In addition,the predictor may perform an intra block copy (IBC) for prediction of ablock. The intra block copy may be used for content image/moving imagecoding of a game or the like, for example, screen content coding (SCC).The IBC basically performs prediction in the current picture, but may beperformed similarly to inter prediction in that a reference block isderived in the current picture. That is, the IBC may use at least one ofinter prediction techniques described in the present document.

The intra predictor 332 may predict the current block by referring tothe samples in the current picture. The referred samples may be locatedin the neighborhood of the current block, or may be located apart fromthe current block according to the prediction mode. In intra prediction,prediction modes may include a plurality of non-directional modes and aplurality of directional modes. The intra predictor 332 may determinethe prediction mode to be applied to the current block by using theprediction mode applied to the neighboring block.

The inter predictor 331 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. In this case, in order to reducethe amount of motion information being transmitted in the interprediction mode, motion information may be predicted in the unit ofblocks, subblocks, or samples based on correlation of motion informationbetween the neighboring block and the current block. The motioninformation may include a motion vector and a reference picture index.The motion information may further include information on interprediction direction (L0 prediction, L1 prediction, Bi prediction, andthe like). In case of inter prediction, the neighboring block mayinclude a spatial neighboring block existing in the current picture anda temporal neighboring block existing in the reference picture. Forexample, the inter predictor 331 may construct a motion informationcandidate list based on neighboring blocks, and derive a motion vectorof the current block and/or a reference picture index based on thereceived candidate selection information. Inter prediction may beperformed based on various prediction modes, and the information on theprediction may include information indicating a mode of inter predictionfor the current block.

The adder 340 may generate a reconstructed signal (reconstructedpicture, reconstructed block, or reconstructed sample array) by addingthe obtained residual signal to the prediction signal (predicted blockor predicted sample array) output from the predictor 330. if there is noresidual for the processing target block, such as a case that a skipmode is applied, the predicted block may be used as the reconstructedblock.

The adder 340 may be called a reconstructor or a reconstructed blockgenerator. The generated reconstructed signal may be used for the intraprediction of a next block to be processed in the current picture, andas described later, may also be output through filtering or may also beused for the inter prediction of a next picture.

Meanwhile, a lama mapping with chrorna scaling (LMCS) may also beapplied in the picture decoding process.

The filter 350 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter350 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture, and store the modifiedreconstructed picture in the memory 360, specifically, in a DPB of thememory 360. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like.

The (modified) reconstructed picture stored in the DPB of the memory 360may be used as a reference picture in the inter predictor 331. Thememory 360 may store the motion information of the block from which themotion information in the current picture is derived (or decoded) and/orthe motion information of the blocks in the picture having already beenreconstructed. The stored motion information may be transferred to theinter predictor 331 so as to be utilized as the motion information ofthe spatial neighboring block or the motion information of the temporalneighboring block. The memory 360 may store reconstructed samples ofreconstructed blocks in the current picture, and transfer thereconstructed samples to the intra predictor 332.

In the present specification, the embodiments described in the predictor330, the dequmtizer 321, the inverse transformer 322. and the filter 350of the decoding apparatus 300 may also be applied in the same manner orcorresponding to the predictor 220, the dequantizer 234, the inversetransformer 235, and the filter 260 of the encoding apparatus 200.

Meanwhile, as described above, in performing video coding, prediction isperformed to improve compression efficiency. Through this, a predictedblock including prediction samples for a current block as a block to becoded (i.e., a coding target block) may be generated. Here, thepredicted block includes prediction samples in a spatial domain (orpixel domain). The predicted block is derived in the same manner in anencoding apparatus and a decoding apparatus, and the encoding apparatusmay signal information (residual information) on residual between theoriginal block and the predicted block, rather than an original samplevalue of an original block, to the decoding apparatus, therebyincreasing image coding efficiency. The decoding apparatus may derive aresidual block including residual samples based on the residualinformation, add the residual block and the predicted block to generatereconstructed blocks including reconstructed samples, and generate areconstructed picture including the reconstructed blocks.

The residual information may be generated through a transform andquantization procedure. For example, the encoding apparatus may derive aresidual block between the original block and the predicted block,perform a transform procedure on residual samples (residual samplearray) included in the residual block to derive transform coefficients,perform a quantization procedure on the transform coefficients to derivequantized transform coefficients, and signal related residualinformation to the decoding apparatus (through a bit stream). Here, theresidual information may include value information of the quantizedtransform coefficients, location information, a transform technique, atransform kernel, a quantization parameter, and the like. The decodingapparatus may perform dequanti zation/in verse transform procedure basedon the residual information and derive residual samples (or residualblocks). The decoding apparatus may generate a reconstructed picturebased on the predicted block and the residual block. Also, for referencefor inter prediction of a picture afterward, the encoding apparatus mayalso dequantize/inverse-transform the quantized transform coefficientsto derive a residual block and generate a reconstructed picture basedthereon.

FIG. 4 schematically illustrates a multi-transform technique accordingto the present document.

Referring to FIG. 4 , a transformer may correspond to the transformer inthe encoding apparatus of FIG. 2 as described above, and an inversetransformer may correspond to the inverse transformer in the encodingapparatus of FIG. 2 , or the inverse transformer in the decodingapparatus of FIG. 3 as described above.

The transformer may derive (primary) transform coefficients byperforming, primary transform based on residual sample (residual samplearray) in a residual block (S410). Such primary transform may bereferred to as a core transform. Here, the primary transform may bebased on multiple transform selection (MTS), and in case that themulti-transform is applied as the primary transform, it may be referredto as multi core transform.

For example, the multi core transform may represent a transform methodby additionally using discrete cosine transform (DCT) type 2 (DCT-II),discrete sine transform (DST) type 7 (DST-VII), DCT type 8 (DCT-VIII),and/or DST type 1 (DST-I). That is, the multi core transform mayrepresent a transform method for transforming a residual signal (orresidual block) of a spatial domain into transform coefficients (orprimary transform coefficients) of a frequency domain based on aplurality of transform kernels selected among the DCT type 2, the DSTtype 7, the DCT type 8, and the DST type 1. Here, the primary transformcoefficients may be called temporary transform coefficients on thetransformer side.

In other words, in case that the existing transform method is applied,transform of the spatial domain for the residual signal (or residualblock) into the frequency domain may be applied based on the DCT type 2,and the transform coefficients may be generated. However, unlike this,in case that the multi core transform is applied, transform of thespatial domain for the residual signal (or residual block) into thefrequency domain may be applied based on the DCT type 2, DST type 7, DCTtype 8, and/or DST type 1, and the transform coefficients (or primarytransform coefficients) may be generated. Here, the DCT type 2, DST type7, DCT type 8, and DST type 1 may be called the transform type,transform kernel, or transform core. The DCT/DST transform types may bedefined based on basis functions.

In case that the multi core transform is performed, a vertical transformkernel and/or a horizontal transform kernel for a target block may beselected among the transform kernels, a vertical transform for thetarget block may be performed based on the vertical transform kernel,and a horizontal transform for the target block may be performed basedon the horizontal transform kernel. Here, the horizontal transform mayrepresent a transform for horizontal components of the target block, andthe vertical transform may represent a transform for vertical componentsof the target block. The vertical transform kernel/horizontal transformkernel may be adaptively determined based on the prediction mode and/ortransform index of the target block (CU or subblock) including theresidual block.

Further, for example, in case of performing primary transform byapplying MTS, specific basis functions may be configured to specifiedvalues, and in case of the vertical transform or horizontal transform,the mapping relationship for the transform kernel may be configured bycombining what basis functions are applied. For example, in case thatthe horizontal direction transform kernel is represented by trTypeHor,and the vertical direction transform kernel is represented by trTypeVer,the trIypeHor or trTypeVer having a value of 0 may be configured asDCT2, and the trTypeHor or trIypeVer having a value of 1 may beconfigured as DST7. The trTypeHor or trTypeVer having a value of 2 maybe configured as DCTS.

Alternatively, for example, in order to indicate any one of a pluralityof transform kernel sets, MTS index may be encoded, and MTS indexinformation may be signaled to the decoding apparatus. Here, the MTSindex may be represented as tu_mts_idx syntax element or mts_idx syntaxelement. For example, if the MTS index is 0, it may be represented thattrTypeHor and trTypeVer values are all 0, and (trTypeHor,trTypeVer)=(DCT2, DCT2). If the MTS index is 1, it may be representedthat trTypeHor and trIypeVer values are all 1, and (trTypeHor,trTypeVer)=(DST7, DST7). If the MTS index is 2, it may be representedthat the trTypeHor value is 2, and the trTypeVer value is 1, and(trTypeHor, trTypeVer) =(DCTS, DST7). If the MTS index is 3, it may berepresented that the trTypeHor value is 1, and the trTypeVer value is 2,and (trTypeHor, trTypeVer)=(DST7, DCTS). If the MTS index is 4, it maybe represented that the trTypeHor and trTypeVer values are all 2, and(trTypeHor, trTypeVer)=(DCTS, DCTS). For example, the transform kernelset according to the MTS index may be represented as in the followingtable.

TABLE 1 MTS index 0 1 2 3 4 trTypeHor 0 1 2 1 7 trTypeVer 0 1 1 2 2

The transformer may derive modified (secondary) transform coefficientsby performing secondary transform based on the (primary) transformcoefficients (S420). The primary transform may be a transform of thespatial domain into the frequency domain, and the secondary transformmay represent a transform into a more compressive expression by using acorrelation existing between the (primary) transform coefficients.

For example, the secondary transform may include a non-separabletransform. In this case, the secondary transform may be called anon-separable secondary transform (NSST) or a mode-dependentnon-separable secondary transform (MDNSST). The non-separable secondarytransform may represent a transform for generating modified transformcoefficients (or secondary transform coefficients) for the residualsignal by secondarily transforming the (primary) transform coefficientsderived through the primary transform based on a non-separable transformmatrix. Here, the vertical transform and the horizontal transform maynot be separately (or independently) applied with respect to the(primary) transform coefficients based on the non-separable transformmatrix, but may be applied all at once.

In other words, the non-separable secondary transform may represent atransform method for rearranging, for example, two-dimensional signals(transform coefficients) to one-dimensional signal through aspecifically determined direction (e.g., row-first direction orcolumn-first direction), without separating the (primary) transformcoefficients into vertical components and horizontal components, andthen generating modified transform coefficients (or secondary transformcoefficients) based on the non-separable transform matrix.

For example, the row-first direction (or order) may represent anarrangement of an MxN block in a line in the order of a first row to anN-th row and the column-first direction (or order) may represent anarrangement of an MxN block in a line in the order of a first column toan M-th column. Here, M and N may represent a width (W) and a height (H)of the block, and may be all positive integers.

For example, the non-separable secondary transform may be applied to atop-left area of the block composed of (primary) transform coefficients(hereinafter, transform coefficient block). For example, if the width(W) and the height (H) of the transform coefficient block are all equalto or larger than 8, 8×8 non-separable secondary transform may beapplied to the top-left 8×8 area of the transform coefficient block.Further, if the width (W) and the height (H) of the transformcoefficient block are all equal to or larger than 4 and smaller than 8,4×4 non-separable secondary transform may be applied to the top-left min(8, W)×min (8, H) area of the transform coefficient block. However,embodiments are not limited thereto, and for example, even if acondition that the width (W) and the height (H) of the transformcoefficient block are all equal to or larger than 4 is satisfied, the4×4 non-separable secondary transform may be applied to the top-left min(8, W)×min (8, H) area of the transform coefficient block.

Specifically, for example, in case that a 4×4 input block is used, thenon-separable secondary transform may be performed as follows.

The 4×4 input block X may be represented as follows.

$\begin{matrix}{X = \begin{bmatrix}X_{00} & X_{01} & X_{02} & X_{03} \\X_{10} & X_{11} & X_{12} & X_{13} \\X_{20} & X_{21} & X_{22} & X_{23} \\X_{30} & X_{31} & X_{32} & X_{33}\end{bmatrix}} & \left\lbrack {{Equation}1} \right\rbrack\end{matrix}$

For example, the vector form of the X may be represented as follows.

={X₀₀ X₀₁ X₀₂ X₀₃ X₁₀ X₁₁ X₁X₁₃ X₂₀ X₂₁ X₂₂ X₂₃ X₃₀ X₃₁ X₃₂X₃₃}^(T)  [Equation 2]

Referring to Equation 2,

may represent the vector X, and the two-dimensional block of the X inEquation 1 may be rearranged and represented as the one-dimensionalvector in accordance with the row-first order.

In this case, the secondary non-separable transform may be calculated asfollows.

=T·

  [Equation 3]

Here,

may represent a transform coefficient vector, and T may represent 16×16(non-separable) transform matrix.

Based on Equation 3,

having a size of 16×1 may be derived, and

may be reorganized as 4×4 block through a scan order (horizontal,vertical, or diagonal). However, the above-described calculation isexemplary, and in order to reduce calculation complexity of thenon-separable secondary transform, hypercube-givens transform (HyGT) andthe like may be used to calculate the non-separable secondary transform.

Meanwhile, in the non-separable secondary transform, a transform kernel(or transform core or transform type) may be selected in a modedependent manner. Here, the mode may include an intra prediction modeand/or an ter prediction mode.

For example, as described above, the non-separable secondary transformmay be performed based on the 8×8 transform or 4×4 transform determinedbased on the width (W) and the height (H) of the transform coefficientblock. For example, if the W and H are all equal to or larger than 8,the 8×8 transform may represent a transform that can be applied to the8×8 area included inside the corresponding transform coefficient block,and the 8×8 area may be the top-left 8×8 area inside the correspondingtransform coefficient block. Further, similarly, if the W and H are allequal to or larger than 4, the 4×4 transform may represent a transformthat can be applied to the 4×4 area included inside the correspondingtransform coefficient block, and the 4×4 area may be the top-left 4×4area inside the corresponding transform coefficient block. For example,an 8×8 transform kernel matrix may be a 64×64/16×64 matrix, and a 4×4transform kernel matrix may be a 16×16/8×16 matrix.

In this case, for mode-based transform kernel selection, twonon-separable secondary transform kernels per transform set for thenon-separable secondary transform may be configured with respect to allof the 8×8 transform and the 4×4 transform, and four transform sets maybe provided. That is, four transform sets may be configured with respectto the 8 ×8 transform, and four transform sets may be configured withrespect to the 4×4 transform. In this case, each of the four transformsets for the 8×8 transform may include two 8×8 transform kernels, andeach of the four transform sets for the 4×4 transform may include two4×4 transform kernels.

However, the size of the transform, the number of sets, and the numberof transform kernels in the set are exemplary, and a size excluding the8×8 or 4×4 may be used, or n sets may be configured, or k transformkernels may be included in each set. Here, n and k may be positiveintegers.

For example, the transform set may be called an NSST set, and thetransform kernel in the NSST set may be called an NSST kernel. Forexample, selection of a specific set among the transform sets may beperformed based on the intra prediction mode of the target block (CU orsubblock).

For example, the intra prediction mode may include two non-directionalor non-angular intra prediction modes and 65 directional or angularintra prediction modes. The non-directional intra prediction modes mayinclude No. 0 planar intra prediction mode and No. 1 DC intra predictionmode, and the directional intra prediction modes may include 65 (No. 2to No. 66) intra prediction modes. However, this is exemplary, and theembodiment according to the present document may be applied even to acase that a different number of intra prediction modes is provided.Meanwhile, in some cases, No. 67 intra prediction mode may be furtherused, and the No. 67 intra prediction mode may represent a linear model(IrM) mode.

FIG. 5 exemplarily illustrates intra directional rnodes in 65 predictiondirections.

Referring to FIG. 5 , modes may be divided into intra prediction modeshaving horizontal directionality and intra prediction modes havingvertical directionality around No. 34 intra prediction mode havingtop-left diagonal prediction direction. In FIG. 5 , H and V may mean thehorizontal directionality and the vertical directionality, respectively,and numerals of −32 to 32 may represent displacements in the unit of1/32 on a sample grid position. This may represent an offset for a modeindex value.

For example, No. 2 to No. 33 intra prediction modes may have thehorizontal directionality, and. No. 34 to No. 66 intra prediction modeshave the vertical directionality. Meanwhile, technically speaking, No,34 intra prediction mode may be considered to have neither thehorizontal directionality nor the vertical directionality, but may beclassified to belong to the horizontal directionality from the viewpointof determining the transform set of the secondary transform. This isbecause input data is transposed and used with respect to the verticaldirection modes being symmetrical around the No. 34 intra predictionmode, and an input data arrangement method for the horizontal directionmode is used with respect to the No. 34 intra prediction mode. Here,transposing of the input data may mean configuration of N×M data in amanner that rows become columns and columns become rows with respect totwo-dimensional block data M×N.

Further, No. 18 intra prediction mode and No. 50 intra prediction modemay represent a horizontal intra prediction mode and a vertical intraprediction mode, respectively, and No. 2 intra prediction mode may becalled top-right diagonal intra prediction mode since prediction is madein the top-right direction with a left reference pixel. In the samecontext, No. 34 intra prediction mode may be called a bottom-rightdiagonal intra prediction mode, and No. 66 intra prediction mode may becalled a bottom-left diagonal intra prediction mode.

Meanwhile, if it is determined that a specific set is used fornon-separable transform, one of k transform kernels in the specific setmay be selected through the non-separable secondary transform index. Forexample, the encoding apparatus may derive the non-separable secondarytransform index representing a specific transform kernel based on arate-distortion (RD) check, and may signal the non-separable secondarytransform index to the decoding apparatus. For example, the decodingapparatus may select one of the k transform kernels in the specific setbased on the non-separable secondary transform index. For example, anNSST index having a value of 0 may represent a first non-separablesecondary transform kernel, an NSST index having a value of I mayrepresent a second non-separable secondary transform kernel, and an NSSTindex having a value of 2 may represent a third non-separable secondarytransform kernel. Alternatively, an NSST index having a value of 0 mayrepresent that the first non-separable secondary transform is notapplied to the target block, and an NSST index having a value of 1 to 3may indicate the three transform kernels as above.

The transformer may perform the non-separable secondary transform basedon the selected transform kernels, and may obtain modified (secondary)transform coefficients. The modified transform coefficients may bederived as quantized transform coefficients through the above-describedquantizer, and may be encoded to be signaled to the decoding apparatusand may be transferred to the dequantizer/inverse transformer in theencoding apparatus.

Meanwhile, if the secondary transform is omitted as described above, the(primary) transform coefficients that are outputs of the primary(separable) transform may be derived as the quantized transformcoefficients through the quantizer as described above, and may beencoded to be signaled to the decoding apparatus and may be transferredto the dequantizer/inverse transformer in the encoding apparatus.

Referring again to FIG. 4 , the inverse transformer may perform a seriesof procedures in reverse order to the procedures performed by theabove-described transformer. The inverse transformer may receive(dequantized) transform coefficients, derive (primary) transformcoefficients by performing secondary (inverse) transform (S450), andobtain a residual block (residual samples) by performing primary(inverse) transform with respect to the (primary) transform coefficients(S460). Here, the primary transform coefficients may be called modi fledtransform coefficients on the inverse transformer side. As describedabove, the encoding apparatus and; or the decoding apparatus maygenerate a reconstructed block based on the residual block and apredicted block, and may generate a reconstructed picture based on this.

Meanwhile, the decoding apparatus may further include a secondaryinverse transform application/non-application determiner (or element fordetermining whether to apply the secondary inverse transform) and a.secondary inverse transform determiner (or element for determining thesecondary inverse transform). For example, the secondary inversetransform application/non-application determiner may determine whetherto apply the secondary inverse transform. For example, the secondaryinverse transform may be NSST or RST, and the secondary inversetransform application/non-application determiner may determine whetherto apply the secondary inverse transform based on a secondary transformflag parsed or obtained from a bitstream. Alternatively, for example,the secondary inverse transform application/non-application determinermay determine whether to apply the secondary inverse transform based onthe transform coefficient of the residual block.

The secondary inverse transform determiner may determine the secondaryinverse transform. In this case, the secondary inverse transformdeterminer may determine the secondary inverse transform being appliedto the current block based on the NSST (or RST) transform set designatedin accordance with the intra prediction mode. Alternatively, a secondarytransform determination method may be determined depending on a primarytransform determination method. Alternatively, various combinations ofthe primary transform and the secondary transform may be determined inaccordance with the intra prediction mode. For example, the secondaryinverse transform determiner may determine an area to which thesecondary inverse transform is applied based on the size of the currentblock.

Meanwhile, if the secondary (inverse) transform is omitted as describedabove, the residual block (residual samples) may be obtained byreceiving the (dequantized) transform coefficients and performing theprimary (separable) inverse transform. As described above, the encodingapparatus and/or the decoding apparatus may generate a reconstructedblock based on the residual block and the predicted block, and maygenerate a reconstructed picture based on this.

Meanwhile, in the present document, in order to reduce a computationamount and a memory requirement amount being accompanied by thenon-separable secondary transform, a reduced secondary transform (RST)having a reduced size of the transform matrix (kernel) may be applied onthe concept of NSST.

In the present document, the RST may mean a (simplification) transformbeing performed with respect to the residual samples for the targetblock based on the transform matrix of which the size is reduced inaccordance with a simplification factor. In case of performing this, thecomputation amount being required during the transform may be reduceddue to the reduction of the size of the transform matrix. That is, theRST may be used to solve the computation complexity issue occurringduring the transform of a block having a large size or on-separabletransform.

For example, the RST may be referred to as various terms, such asreduced transform, reduced secondary transform, reduction transform,simplified transform, or simple transform, and names to which the RST isreferred are not limited to the enumerated examples. Further, the RST ismainly performed in a low-frequency domain including coefficients thatare not 0 in the transform block, and thus may be called a low-frequencynon-separable transform (LFNST).

Meanwhile, in case that the secondary inverse transform is performedbased on the RST, the inverse transformer 235 of the encoding apparatus200 and the inverse transformer 322 of the decoding apparatus 300 mayinclude an inverse RST unit deriving modified transform coefficientsbased on the inverse RST for the transform coefficients, and an inverseprimary transformer deriving residual samples for the target block basedon the inverse primary transform for the modified transformcoefficients. The inverse primary transform means an inverse transformof the primary transform having been applied to the residual. In thepresent document, derivation of the transform coefficients based on thetransform may mean derivation of the transform coefficients by applyingthe corresponding transform.

FIGS. 6 and 7 are diagrams explaining RST according to an embodiment ofthe present document.

For example, FIG. 6 may be a figure explaining that a forward reducedtransform is applied, and FIG. 7 may be a figure explaining that aninverse reduced transform is applied. In the present document, thetarget block may represent the current block, a residual block, or atransform block of which coding is performed.

For example, in the RST, an N-dimensional vector may be mapped on anR-dimensional vector located in another space, and a reduced transformmatrix may be determined. Here, N and R may be positive integers, and Rmay be smaller than N. N may mean a square of a length of one side of ablock to which transform is applied or the total number of transformcoefficients corresponding to the block to which the transform isapplied, and a simplification factor may mean an R/N value. Thesimplification factor may be referred to as various terms, such asreduced factor, reduction factor, simplified factor, or simple factor.Meanwhile, R may be referred to as a reduced coefficient, and in somecases, the simplification factor may mean the R. Further, in some cases,the simplification factor may mean the N/R value.

For example, the simplification factor or the reduced coefficient may besignaled through the bitstream, but is not limited thereto. For example,predefined values for the simplification factor or the reducedcoefficient may be stored in the encoding apparatus 200 and the decodingapparatus 300, and in this case, the simplification factor or thereduced coefficient may not be separately signaled.

For example, the size (R×N) of the simplification transform matrix maybe smaller than the size (NxN) of a regular transform matrix, and may bedefined as in the following equation.

$\begin{matrix}{T_{RxN} = \begin{bmatrix}t_{11} & t_{12} & t_{13} & \ldots & t_{1N} \\t_{21} & t_{22} & t_{23} & & t_{2N} \\ & \vdots & & \ddots & \vdots \\t_{R1} & t_{R2} & t_{R3} & \ldots & t_{RN}\end{bmatrix}} & \left\lbrack {{Equation}4} \right\rbrack\end{matrix}$

For example, the matrix T in the reduced transform block illustrated inFIG. 6 may represent the matrix T_(R×N) of Equation 4. As shown in FIG.6 , in case that the residual samples for the target block is multipliedby the simplification transform matrix T_(R×N), the transform.coefficients for the target block may be derived.

For example, in case that the size of the block to which the transformis applied is 8×8, and R is 16 (i.e., R/N=16/64 =1/4), the RST accordingto FIG. 6 may be expressed by a matrix operation as in Equation 5 below.In this case, the memory and the multiplication operation may be reducedto about ¼ by the simplification factor. 11391 In the present document,the matrix operation may be understood as an operation of obtaining acolumn vector by placing the matrix on the left side of the columnvector and multiplying the matrix and the column vector.

$\begin{matrix}{\begin{bmatrix}t_{1,1} & t_{1,2} & t_{1,3} & \ldots & t_{1,64} \\t_{2,1} & t_{2,2} & t_{2,3} & & t_{2,64} \\ & \vdots & & \ddots & \vdots \\t_{16,1} & t_{16,2} & t_{16,3} & \ldots & t_{16,64}\end{bmatrix} \times \begin{bmatrix}r_{1} \\r_{2} \\ \vdots \\r_{64}\end{bmatrix}} & \left\lbrack {{Equation}5} \right\rbrack\end{matrix}$

In Equation 5, ri to r64 may represent residual samples for the targetblock.

Alternatively, for example, they may be transform coefficients generatedby applying the primary transform. Based on the result of the operationof Equation 5, transform coefficients Ci for the target block may bederived.

For example, in case that R is 16, transform coefficients ci to cio forthe target block may be derived. If the transform matrix having a sizeof 64 ×64 (NxN) through application of a regular transform rather thanthe RST is multiplied by the residual samples having a size of 64x 1(Nx1), 64 (N) transform coefficients for the target block may bederived, but since the RST is applied. only 16 (N) transformcoefficients for the target block may be derived. Since the total numberof transform coefficients for the target block is reduced from N to R,the amount of data that the encoding apparatus 200 transmits to thedecoding apparatus 300 may be reduced, and thus transmission efficiencybetween the encoding apparatus 200 and the decoding apparatus 300 may beincreased.

In consideration of the size of the transform matrix, since the size ofthe regular transform matrix is 64 ×64 (NxN), and the size of thesimplification transform matrix is reduced to 16×64 (R×N), the memoryusage when performing the RST can be reduced in an RN ratio as comparedwith a case that the regular transform is performed. Further, ascompared with the number (N×N) of multiplication operations when usingthe regular transform matrix, the usage of the simplification transformmatrix can reduce the number of multiplication operations (R×N) in theR/N ratio.

In an embodiment, the transformer 232 of the encoding apparatus 200 mayderive the transform coefficients for the target block by performingprimary transform and RST-based secondary transform of the residualsamples for the target block. The transform coefficients may betransferred to the inverse transformer of the decoding apparatus 300,and the inverse transformer 322 of the decoding apparatus 300 may derivethe modified transform coefficients based on inverse reduced secondarytransform (RST) for the transform coefficients, and may derive theresidual samples for the target block based on the inverse primarytransform of the modified transform coefficients.

The size of the inverse RST matrix T_(N×R) according to an embodimentmay be N×R that is smaller than the size N×N of the regular inversetransform matrix, and may be in transpose relationship with thesimplification transform matrix T_(R×N) illustrated in Equation 4.

The matrix T₁ in the reduced inverse transform block illustrated in FIG.7 may represent an inverse RST matrix T_(R×N) ^(T). Here, thesuperscript T may represent the transpose. As shown in FIG. 7 , in casethat the transform coefficients for the target block is multiplied bythe inverse RST matrix T_(R×N) ^(T), the modified transform coefficientsfor the target block or the residual samples for the target block may bederived. The inverse RST matrix T_(R×N) ^(T) may be expressed as(T_(R×N))^(T) _(N×R).

More specifically, in case that the inverse RST is applied as thesecondary inverse transform, the modified transform coefficients for thetarget block may be derived by multiplying the transform coefficientsfor the target block by the inverse RST matrix T_(R×N) ^(T). Meanwhile,the inverse RST may be applied as the inverse primary transform, and inthis case, the residual samples fo the target block may be derived bymultiplying the transform coefficients for the target block by theinverse RST matrix T_(R×N) ^(T).

In an embodiment, in case that the size of the block to which theinverse transform is applied is 8×8, and R is 16 (i.e. =16/64=1/4), theRST according to FIG. 7 may be expressed by a matrix operation as inEquation 6 below.

$\begin{matrix}{\begin{bmatrix}t_{1,1} & t_{2,1} & & t_{16,1} \\t_{1,2} & t_{2,2} & \ldots & t_{16,2} \\t_{1,3} & t_{2,3} & & t_{16,3} \\ & \vdots & \ddots & \vdots \\t_{1,64} & t_{2,64} & \ldots & t_{16,64}\end{bmatrix} \times \begin{bmatrix}c_{1} \\c_{2} \\ \vdots \\c_{16}\end{bmatrix}} & \left\lbrack {{Equation}6} \right\rbrack\end{matrix}$

In Equation 6, c₁ to c₁₆ may represent transform coefficients for thetarget block. r_(j) representing the modified transform coefficients forthe target block or the residual samples for the target block may bederived based on the result of the operation of Equation 6. That is,r_(i) to rx representing the modified transform coefficients for thetarget block or the residual samples for the target block may bederived.

In consideration of the size of the inverse transform matrix, since thesize of the regular inverse transform matrix is 64×64 (N×N), and thesize of the simplification inverse transform matrix is reduced to 64×16(N×R), the memory usage when performing the inverse RST can be reducedin an ratio as compared with a case that the regular inverse transformis performed. Further, as compared with the number (N×N) ofmultiplication operations when using the regular inverse transformmatrix, the usage of the simplification inverse transform matrix canreduce the number of multiplication operations (N×R) in the R/N ratio.

Meanwhile, transform sets may be configured and applied even withrespect to 8×8 RST. That is, the corresponding 8×8 RST may be applied inaccordance with the transform set. Since one transform set is composedof two or three transform kernels in accordance with the intraprediction mode, it may be configured to select one of four transformsat maximum including even a case that the secondary transform is notapplied. In the transform when the secondary transform is not applied,it may be considered that an identity matrix has been applied. If it isassumed that an index of 0, 1, 2, or 3 is given for four transforms(e.g., No. 0 index may be allocated to a case that the identity matrix,that is, secondary transform, is not applied), the transform to beapplied may be designated by signaling a syntax element that is an NSSTindex to every transform coefficient block. That is, through the NSSTindex, 8×8 NSST may be designated for an 8×8 top-left block, and in theRST configuration, 8×8 RST may be designated. The 8×8 NSST and the 8×8RST may represent transforms capable of being applied to the 8×8 areaincluded inside the corresponding transform coefficient block in casethat the W and the H of the target block that becomes the target of thetransform are all equal to or larger than 8, and the 8×8 area may be thetop-left 8 ×8 area inside the corresponding transform coefficient block.Similarly, the 1×4 NSST and the 4 ×4 RST may represent transformscapable of being applied to the 4 ×4 area included inside thecorresponding transform coefficient block in case that the W and the Hof the target block are all equal to or larger than 4, and the 4×4 areamay be the top-left 4×4 area inside the corresponding transformcoefficient block.

Meanwhile, for example, the encoding apparatus may derive the bitstreamby encoding the value of the syntax element or the quantized values ofthe transform coefficient for the residual based on various codingmethods, such as exponential Golomb, context-adaptive variable lengthcoding (CAVLC), context-adaptive binary arithmetic coding (CABAC), andthe like. Further, the decoding apparatus may derive the value of thesyntax element or the quantized values of the transform coefficient forthe residual based on various coding methods, such as exponential Golombencoding, CAVLC, CABAC, and the like.

For example, the above-described coding methods may be performed as thecontents to be described later.

FIG. 8 exemplarily illustrates context-adaptive binary arithmetic coding(CABAC) for encoding a syntax element.

For example, in a CABAC coding process, if an input signal is a syntaxelement that is not a binary value, a value of the input signal may betransformed into a binary value through binarization. Further, if theinput signal is already the binary value (i.e., if the value of theinput signal is the binary value), the binarization may not beperformed, but the input signal may be used as it is. Here, each binarynumber 0 or 1 constituting the binary value may be called a bin. Forexample, if a binary string after the binarization is 110, each of 1, 1,and 0 may be represented as one bin. The bin(s) for one syntax elementmay represent the value of the syntax element. The binarization may bebased on various binarization method, such as a truncated ricebinarization process or a fixed-length binarization process, and thebinarization method for a target syntax element may be predefined. Thebinarization procedure may be performed by a. binarizer in an entropyencoder.

Thereafter, the binarized bins of the syntax element may be input to aregular coding engine or a bypass coding engine. The regular codingengine of the encoding apparatus may allocate a context model thatreflects a probability value with respect to the corresponding bin, andencode the corresponding bin based on the allocated context model. Theregular coding engine of the encoding apparatus may update the contextmodel for the corresponding bin after performing coding with respect tothe respective bins. The bins being coded as the above-describedcontents may be represented as context-coded bins.

Meanwhile, in case that the binarized bins of the syntax element areinput to the bypass coding engine, they may be coded as follows. Forexample, the bypass coding engine of the encoding apparatus may omit aprocedure for estimating probability with respect to the input bin and aprocedure for updating a probability model having been applied to thebin after the coding. In case that the bypass coding is applied, theencoding apparatus may code the input bin by applying regularprobability distribution instead of allocating, the context model, andthrough this, the coding speed can be improved. The bin being coded asthe above-described. contents may be represented as a bypass bin.

Entropy decoding may represent a process for performing the same processas the above-described entropy encoding in reverse order.

The decoding apparatus (entropy decoder) may decode encoded image/videoinformation. The image/video information may includepartitioning-related information, prediction-related information (e.g.,inter/intra, prediction division information, infra prediction modeinformation, inter prediction mode information, and the like), residualinformation, or in-loop filtering-related information, or may includevarious syntax elements thereabout. The entropy coding may be performedin the unit of a syntax element.

The decoding apparatus may perform binarization of target syntaxelements. Here, the binarization may be based on various binarizationmethods, such as a truncated rice binarization process ora fixed-lengthbinarization process, and the binarization method for the target syntaxelement may be predefined. The decoding apparatus may derive availablebin strings (bin string candidates) for available values of the targetsyntax elements through the binarization procedure. The binarizationprocedure may be performed by the hinarizer in the entropy decoder.

The decoding apparatus may compare the derived bin string with availablebin strings for the corresponding syntax elements while sequentiallydecoding or parsing the respective bins for the target syntax elementsfrom input bit(s) in the bitstream. If the derived bin string is equalto one of the available bin strings, the value corresponding to thecorresponding bin string is derived as the value of the correspondingsyntax element. If not, the decoding apparatus may re-perform theabove-described procedure after further parsing the next bit in thebitstream. Through such a process, it is possible to perform signalingof specific information (or specific syntax element) in the bitstreamusing a variable length bit even without using a start bit or an end bitof the corresponding information. Through this, a relatively smaller bitmay be allocated with respect to a smaller value, and thus an overallcoding efficiency can be enhanced.

The decoding apparatus may perform context model-based or bypass-baseddecoding of the respective bins in the bin string from the bitstreambased on an entropy coding technique, such as CABAC or CAVLC.

In case that the syntax element is decoded based on the context model,the decoding apparatus may receive the bin corresponding to the syntaxelement through the bitstream, max determine a context model using thesyntax element and decoding information of the decoding target block orthe neighboring block or symbol/bin information decoded in the previousstage, and may derive the syntax element value by performing arithmeticdecoding of the bin through prediction of the probability of occurrenceof the received bin in accordance with the determined context model.Thereafter, the context model of the bin being next decoded may beupdated based on the determined context model.

The context model may be allocated and updated by context-coded(regularly coded) bins, and the context model may be indicated based oncontext index (ctxIdx) or context index increment (ctxInc). Ctxldx maybe derived based on ctxInc. Specifically, for example, the ctxIdxrepresenting the context model for each of the regularly coded bins maybe derived by the sum of ctxInc and context index offset (ctxIdxOffset).For example, the ctxInc may be differently derived by bins. ThectxIdx0ffset may be represented as the lowest value of the ctxIdx.Generally, the ctxidxOffset may be a value being used to distinguish thesame from context models for other syntax elements, and the contextmodel for one syntax element may be divided or derived based on thectxInc.

In the entropy encoding procedure, it may be determined whether toperform encoding through the regular coding engine or to performencoding through the bypass coding engine, and accordingly, a codingpath may be switched. Entropy decoding may perform the same process asthe entropy encoding in reverse order.

Meanwhile, for example, in case that the syntax element isbypass-decoded, the decoding apparatus may receive the bin correspondingto the syntax element through the bitstream, and may decode the inputbin by applying regular probability distribution. In this case, thedecoding apparatus may omit a procedure of deriving the context model ofthe syntax element and a procedure of updating the context model appliedto the bin after the decoding.

Meanwhile, an embodiment of the present document may propose a schemefor signaling an MTS index. Here, the MTS index, as described above, mayrepresent any one of a plurality of transform kernel sets, and the MTSindex may be encoded and MTS index information may be signaled to thedecoding apparatus. The decoding apparatus may obtain the MTS index bydecoding the MTS index information, and may determine a transform kernelset to be applied based on the MTS index. The MTS index may berepresented as a to nits idx syntax element or an mts_idx syntaxelement. For example, the MTS index may be binarized using Rice-Goln bparameter 0^(th) order, but may be binarized based on truncated rice. Incase of the binarization based on the truncated rice, an input parametercMax may have the value of 4, and cRiceParam may have the value of 0.For example, the encoding apparatus may derive bin(s) for the MTS indexby binarizing the MTS index, derive MTS index information (bit(s) forMTS index) by encoding the derived bin(s), and signal the MTS indexinformation to the decoding apparatus. The decoding apparatus may derivethe bin(s) for the MTS index by decoding the MTS index information, andderive the MTS index by comparing the derived bin(s) for the MTS indexwith candidate bin(s) for the MTS index.

For example, the MTS index (e.g., tu_mts_idx syntax element or mts_idssyntax element) may be context-coded based on the context model orcontext index with respect to all bins. In this case, a context indexincrement (ctixInc) for context coding of the MTS index or ctxIncaccording to the bin location may be allocated or determined as in Table2. Further, a context model may be selected according to the binlocation as in Table 2.

TABLE 2 binIdx Syntax element 0 1 2 3 4 >=5 tu_mts_idx[ ][ ] cqtDepth 67 8 na Na

Referring to Table 2, the ctxInc for No. 0 bin (first bin) may beallocated based on cqtDepth. Here, the cqtDepth may represent aquad-tree depth for the current block, and may be derived as one valueof 0 to 5. That is, the ctxInc for the 0^(th) bin may be allocated withone value of 0 to 5 according to the cqtDepth. Further, the ctxInc forNo. 1 bin (second bin) may be allocated with 6, the ctxInc for No. 2 bin(third bin) may be allocated with 7, and the ctxInc for No. 3 bin(fourth bin) may be allocated with 8. That is, No. 0 bin to No. 3 binmay be allocated with ctxInc having different values. Here, thedifferent ctxinc value may represent different context models, and inthis case, 9 context models for the MTS index coding may be provided.

Further, for example, the MTS index (e.g., tu_mts_idx syntax element ormts_idx syntax element) may be bypass-coded with respect to all bins asin Table 3. In this case, 0 context model for the MTS index coding maybe provided.

TABLE 3 binIdx Syntax element 0 1 2 3 4 >=5 tu_mts_idx[ ][ ] bypassbypass bypass bypass na na

Further, for example, the MTS index (e.g., tu nits idx syntax element ormts idx syntax element) may be context-coded based on the context modelor the context index with respect to N0. 0 bin (first bin) as in Table4, and may be bypass-coded with respect to the remaining bins. That is,the ctxInc for No. 0 bin (first bin) may be allocated with 0. In thiscase, one context model for the MTS index coding may be provided.

TABLE 4 binIdx Syntax element 0 1 2 3 4 >=5 tu_mts_idx[ ][ ] 0 bypassbypass bypass na na

Further, for example, the MTS index (e.g., tu mts idx syntax element ormts_idx syntax element) may be context-coded based on the context modelor the context index with respect to No. 0 bin (first bin) and N0. 1 bin(second bin) as in Table 5, and may be bypass-coded coded with respectto the remaining bins. That is, the ctxInc for No. 0 bin (first bin) maybe allocated with 0, and the ctxInc for No. 1 bin (second bin) may beallocated with 1. In this case, 2 context models for the MTS indexcoding may be provided.

TABLE 5 binIdx Syntax element 0 1 2 3 4 >=5 tu_mts_idx[ ][ ] 0 1 bypassbypass na na

Further, for example, the MTS index (e.g., tu mts idx syntax element ormts_idx syntax element) may be context-coded based on the context modelor the context index with respect to all bins as in Table 6, and mayallocate one more with respect to each bin. That is, the ctxInc for No.0 bin (first bin) may be allocated with 0, and the ctxInc for No. 1 bin(second bin) may be allocated with 1. The ctxInc for No. 2 bin (thirdbin) may be allocated with 2, and the ctxInc for No. 3 bin (fourth bin)may be allocated with 2. In this case, 4 context models for the MTSindex coding may be provided.

TABLE 6 binIdx Syntax element 0 1 2 3 4 >=5 tu_mts_idx[ ][ ] 0 1 2 3 nana

As described above, according to an embodiment, since the number ofcontext models is reduced by applying the bypass coding to all or someof the bins of the MTS index or applying a specific value to the ctxIncalthough the context coding is applied, the complexity may be lowered,and the output amount of the decoder can be increased. Further, in anembodiment, in case of using context models as described above, theinitial value and/or the multi-window size may be variable based on theoccurrence statistics for the position of each bin.

FIGS. 9 and 10 schematically illustrate a video/image encoding methodand an example of related components according to embodiment(s) of thepresent document.

The method disclosed in FIG. 9 may be performed by the encodingapparatus disclosed in FIG. 2 or FIG. 10 . Specifically, for example,S900 to S920 of FIG. 9 may be performed by the residual processor 230 ofthe encoding apparatus of FIGS. 10 , and S930 of FIG. 9 may be performedby the entropy encoder 240 of the encoding apparatus of FIG. 10 .Further, although not illustrated in FIG. 9 , prediction samples orprediction related information may be derived by the predictor 220 ofthe encoding apparatus of FIG. 10 , residual information may be derivedfrom the original samples or the prediction samples by the residualprocessor 230 of the encoding apparatus, and the bitstream may begenerated from the residual information or the prediction relatedinformation by the entropy encoder 240 of the encoding apparatus. Themethod disclosed in FIG. 9 may include the embodiments as describedabove in the present document.

Referring to FIG. 9 . the encoding apparatus derives the residualsamples for the current block (S900). For example, the encodingapparatus may derive the residual samples based on the predictionsamples and the original samples. Although not illustrated in FIG. 9 ,in order to generate the prediction samples for the current block, theencoding apparatus may perform intra prediction or inter prediction withrespect to the current block in consideration of a rate distortion RD)cost, and may generate the prediction related information including theprediction mode/type information.

The encoding apparatus derives the transform coefficients for thecurrent block based on the residual samples (S910). For example, theencoding apparatus may derive transform coefficients by performingtransform with respect to the residual samples. Here, the transform maybe performed based on a transform kernel or a transform kernel set. Forexample, the transform kernel set may include a horizontal directiontransform kernel and a vertical direction transform kernel. For example,the encoding apparatus may derive the transform coefficients byperforming the primary transform with respect to the residual samples.Further, for example, the encoding apparatus may derive temporarytransform coefficients by performing the primary transform with respectto the residual samples, and may derive the transform coefficients byperforming secondary transform with respect to the temporary transformcoefficients. For example, the transform that is performed based on thetransform kernel set may be represented as the primary transform.

The encoding apparatus generates the MTS index and the residualinformation based on the transform coefficients (S920). In other words,the encoding apparatus may generate the MTS index and/or the residualinformation based on the transform coefficients.

The MTS index may represent the transform kernel set applied to (thetransform coefficients) of the current block among the transform kernelset candidates. Here, the MTS index may be represented as the tri mtsidx syntax element or the mts idx syntax element. As described above,the transform kernel set may include the horizontal direction transformkernel and the vertical direction transform kernel, and the horizontaldirection transform kernel may be represented as trTypeHor, and thevertical direction transform kernel may be represented as trTy peV er.

For example, the trTypeHor and trTypeVer values may be represented bythe horizontal direction transform kernel and the vertical directiontransform kernel applied to (the transform coefficients) of the currentblock, and the MTS index may be represented as one of the candidatesincluding 0 to 4 by the trTypeHor and trTypeVer values.

For example, if the MTS index is 0, it may be represented that thetrTypeHo rand the trTypeVer are all 0. Further, if the MTS index is 1,it may represent that the trTypeHor and the trTypeVer are all 1.Further, if the MTS index is 2, it may represent that the trTypeHor is 2and the trTypeVer is 1. If the MTS index is 3, it may represent that thetrTypeHor is 1 and the trTypeVer is 1. Further, if the MTS index is 4,it may represent that the trTypeHor and the trTypeVer are all 2. Forexample, if the trTypeHor or trTypeVer value is 0, it may represent thatDCT2 is applied to (the transform coefficients) of the current block inthe horizontal direction or in the vertical direction, if 1, it mayrepresent that DST7 is applied, and if 2, it may represent that DCTS isapplied. That is, each of the transform kernel to be applied in thehorizontal direction and the transform kernel to be applied in thevertical direction may be represented as one of the candidates includingDCT2, DST7, and DCT8 based on the MTS index.

The MTS index may be represented based on the bins of the bin string ofthe MTS index. In other words, the MTS index may be binarized andrepresented as (the bins) of the bin string of the MTS index, and (thebins) of the bin string of the MTS index may be entropy-encoded.

In other words, at least one of the bins of the bin string of the MTSindex, may be represented based on the context coding. Here, the contextcoding may be performed based on the value of context index increment(ctxInc). Further, the context coding may be performed based on thecontext index (ctxIdx) or context model. Here, the context index may berepresented based on the value of the context index increment. Further,the context index may be represented based on the value of the contextindex increment and the context index offset (ctxIdxOffset).

For example, all of the bins of the bin string of the MTS index may berepresented based on the context codling. For example, the ctxInc forthe first bin or the 0^(th) bin (bin 0) among the bins of the bin stringof the MTS index may be represented based on cqtDepth. Here, thecqtDepth may represent a quad-tree depth for the current block, and maybe represented as one value among 0 to 5. Further, the ctxInc for thesecond bin or No. 1 bin (bin 1) may be represented as 6, the ctxInc forthe third bin or No. 2 bin (bin 2) may be represented as 7, and thectxInc for the fourth bin or No. 3 bin (bin 3) may be represented as 8.Further, for example, the ctxInc for the first bin or the 0^(th) bin(bin 0) among the bins of the bin string of the MTS index may berepresented as 0, the ctxInc for the second bin or No. 1 bin (bin 1) maybe represented as 1, the ctxInc for the third bin or No. 2 bin (bin 2)may be represented as 2, and the ctxinc for the fourth bin or No. 3 bin(bin 3) may be represented as 3. That is, the number of context indexincrement values that can be used for the context coding of the firstbin among the bins of the bin string may be one.

Further, for example, some of the bins of the bind string of the MTSindex may be represented based on the context coding, and the remaindersmay be represented based on the bypass coding. For example, the cixincfor the first bin or No. 0 bin (bin 0) among the bins of the bin stringof the MTS index may be represented as 0, and the remaining bins may berepresented based on the bypass coding. Further, for example, the ctxIncfor the first bin or No. 0 bin (bin 0) among the bins of the bin stringof the MTS index may be represented as 0, the ctxInc for the second binor No. I bin (bin 1) may be represented as 1, and the remaining bins maybe represented based on the bypass coding. That is, the number ofcontext index increment values that can be used for the context codingof the first bin among the bins of the bin string may be one.

Further, all of the bins of the bin string of the MTS index may berepresented based on the bypass coding. Here, the bypass coding mayrepresent performing of the context coding based on the uniformprobability distribution, and since the update procedure of the contextcoding is omitted, the coding efficiency can be improved.

The residual information may represent information that is used toderive the residual samples. Further, for example, the encodingapparatus may perform quantization for the transform coefficients, andthe residual information may include information about the residualsamples, transform related information, and/or quantization relatedinformation. For example, the residual information may includeinformation about the quantized transform coefficients.

The encoding apparatus encodes image information including the MTS indexand the residual information (S930). For example, the image informationmay further include prediction related information. For example, theencoding apparatus may generate a bitstream by encoding the imageinformation. The bitstream may be called encoded (image) information.

Further, although not illustrated in FIG. 9 , for example, the encodingapparatus may generate reconstructed samples based on the residualsamples and the prediction samples. Further, a reconstructed block and areconstructed picture may be derived based on the reconstructed samples.

For example, the encoding apparatus may generate the bitstream orencoded information by encoding the image information including all orsome of the above-described information (or syntax elements). Further,the information may be outputted in the form of a bitstream. Further,the bitstream or the encoded information may be transmitted to thedecoding apparatus through the network or storage medium. Further, thebitstream or the encoded information may be stored in a computerreadable storage medium, and the bitstream or the encoded informationmay be generated by the above-described image encoding method.

FIGS. 11 and 12 schematically illustrate a video/image decoding methodand an example of related components according to embodiment(s) of thepresent document.

The method disclosed in FIG. 11 may be performed by a decoding apparatusdisclosed in FIG. 3 or FIG. 12 . Specifically, for example, S1100 ofFIG. 11 may be performed by the entropy decoder 310 of the decodingapparatus of FIGS. 12 , and S1110 and S1120 of FIG. 11 may be performedby the residual processor 320 of the decoding apparatus of FIG. 12 .Further, although not illustrated in FIG. 11 , the prediction relatedinformation or residual information may be derived from the bitstream bythe entropy decoder 310 of the decoding apparatus of FIG. 12 , and theresidual samples may be derived from the residual information by theresidual processor 320 of the decoding apparatus. The prediction samplesmay be derived from the prediction related information by the predictor330 of the decoding apparatus, and the reconstructed block or thereconstructed picture may be derived from the residual samples or theprediction samples by the adder 340 of the decoding apparatus. Themethod disclosed in FIG. 11 may include the embodiments described abovein the present document

Referring to FIG. 11 , the decoding apparatus obtains the MTS index andthe residual information from the bitstream (S1100). For example, thedecoding apparatus may obtain the MTS index and/or the residualinformation by parsing or decoding the bitstream. Here, the bitstreammay be called encoded (image) information.

The MTS index may represent the transform kernel set to be applied tothe current block among the transform kernel set candidates. Here, theMTS index may be represented as the tu_mts_idx syntax element or themts_idx syntax element. Further, the transform kernel set may includethe transform kernel to be applied to the current block in thehorizontal direction and the transform kernel to be applied to thecurrent block in the vertical direction. Here, the transform kernel tobe applied in the horizontal direction may be represented as trTypeHor,and the transform kernel to be applied in the vertical direction may berepresented as trTypeVer.

For example, the MTS index may be derived as one of candidates including0 to 4, and in accordance with the MTS index, each of the trTypeHor andthe trTypeVer may be derived as one of 0 to 2. For example, if the MTSindex is 0, the trTypeHor and the trTypeVer may be all 0. Further, ifthe MTS index is 1, the trTypeHor and the trTypeVer may be all I.Further, if the MTS index is 2, the trTypeHor may be 2, and thetrTypeVer may be 1. If the MTS index is 3, the trTypeHor may be 1, andthe trTypeVer may be 1. Further, if the MTS index is 4, the trTypeHorand the trTypeVer may be all 2. For example, the trTypeVer or trTypeVervalue may represent the transform kernel, and if 0, it may representDCI2, if 1, it may represent DST7, and if 2, it may represent DCIT8.That is, each of the transform kernel to be applied in the horizontaldirection and the transform kernel to be applied in the verticaldirection may be derived as one of the candidates including DCT2, DST7,and DOTS based on the MTS index. 12031 The MTS index may be derivedbased on the bins of the bin string of the MTS index.

In other words, the MIS index information may be entropy-decoded and maybe derived as a binarized MTS index, and the binarized MTS index may berepresented as (the bins) of the bin string of the MTS index.

In other words, at least one of the bins of the bin string of the MTSindex may be derived based on the context coding. Her, the contextcoding may be performed based on the value of the context indexincrement (ctxinc). Further, the context coding may be performed basedon the context index (ctxIdx) or context model. Here, the context indexmay be derived based on the value of the context index increment.Further, the context index may be derived based on the value of thecontext index increment and the context index offset (ctxIdxOffset).

For example, all of the bins of the bin string of the MTS index may bederived based on the context codling. For example, the ctxInc for thefirst bin or the ^(th) bin (bin 0) among the bins of the bin string ofthe MTS index may be allocated based on cqtDepth. Here, the cqtDepth mayrepresent a quad-tree depth for the current block, and may be derived asone value among 0 to 5. Further, the ctxinc for the second bin or No. 1bin (bin 1) may be allocated with 6, the ctxInc for the third bin or No.2 bin (bin 2) may be allocated with 7, and the ctxInc for the fourth binor No. 3 bin (bin 3) may be allocated with 8. Further, for example, thectxInc for the first bin or the 0^(th) bin (bin 0) among the bins of thebin string of the MTS index may be allocated with 0, the ctxInc, for thesecond bin or No. 1 bin (bin 1) may be allocated with I. the ctxInc forthe third bin or No. 2 bin (bin 2) may be allocated with 2, and thectxinc for the fourth bin or No. 3 bin (bin 3) may be allocated with 3.That is, the number of context index increment values that can be usedfor the context coding of the first bin among the bins of the bin stringmay be one.

Further, for example, some of the bins of the bind string of the MTSindex may be derived based on the context coding, and the remainders maybe derived based on the bypass coding. For example, the ctxInc for thefirst bin or No. 0 bin (bin 0) among the bins of the bin string of theMTS index may be allocated with 0, and the remaining bins may be derivedbased on the bypass coding. Further, for example, the ctxinc for thefirst bin or No. 0 bin (bin 0) among the bins of the bin string of theMTS index may be allocated with 0, the ctxInc for the second bin or No.1 bin (bin 1) may be allocated with 1, and the remaining bins may bederived based on the bypass coding. That is, the number of context indexincrement values that can be used for the context coding of the firstbin among the bins of the bin string may be one.

Further, all of the bins of the bin string of the MTS index may bederived based on the bypass coding. Here, the bypass coding mayrepresent performing of the context coding based on the uniformprobability distribution, and since the update procedure of the contextcoding is omitted, the coding efficiency can be improved.

The residual information may represent information that is used toderive the residual samples, and may include information about theresidual samples, inverse transform related information, and/ordequantization related information. For example, the residualinformation may include information about the quantized transformcoefficients.

The decoding apparatus derives the transform coefficients for thecurrent block based on the residual information (S1110). For example,the decoding apparatus may derive the quantized transform coefficientsfor the current block based on the information about the quantizedtransform coefficients included in the residual information. Forexample, the decoding apparatus may derive the transform coefficientsfor the current block by performing dequantization with respect to thequantized transform coefficients.

The decoding apparatus generates the residual samples of the currentblock based on the MTS index and the transform coefficients (S1120). Forexample, the residual samples may be generated based on the transformkernel set being represented by the transform coefficients and the MTSindex. That is, the decoding apparatus may generate the residual samplesfrom the transform coefficients through the inverse transform using thetransform kernel set being represented by the MTS index. Here, theinverse transform using the transform kernel set being represented bythe MTS index may be included in the primary inverse transform. Further,the decoding apparatus may use not only the primary inverse transformbut also secondary inverse transform when generating the residualsamples from the transform coefficients. In this case, the decodingapparatus may derive the modified transform coefficients by performingthe secondary inverse transform with respect to the transformcoefficients, and may generate the residual samples by performing theprimary inverse transform with respect to the modified transformcoefficients.

Although not illustrated in FIG. 11 , for example, the decodingapparatus may obtain the prediction related information including theprediction modeltype from the bitstream, and may generate the predictionsamples for the current block by performing the intra prediction orinter prediction based on the prediction mode/type information. Further,for example, the decoding apparatus may generate the reconstructedsamples based on the prediction samples and the residual samples.Further, for example, the reconstructed block or the reconstructedpicture may be derived based on the reconstructed samples.

For example, the decoding apparatus may obtain image informationincluding all or parts of the above-described pieces of information (orsyntax elements) by decoding the bitstream or the encoded information.Further, the bitstream or the encoded information may be stored in acomputer readable storage medium, and may cause the above-describeddecoding method to be performed.

Although methods have been described on the basis of a flowchart inwhich steps or blocks are listed in sequence in the above-describedembodiments, the steps of the present document are not limited to acertain order, and a certain step may be performed in a different stepor in a different order or concurrently with respect to that describedabove. Further, it will be understood by those ordinary skilled in theart that the steps of the flowcharts are not exclusive, and another stepmay be included therein or one or more steps in the flowchart may bedeleted without exerting an influence on the scope of the presentdisclosure.

The aforementioned method according to the present disclosure may be inthe form of software, and the encoding apparatus and/or decodingapparatus according to the present disclosure may be included in adevice for performing image processing, for example, a TV, a computer, asmart phone, a set-top box, a display device, or the like.

When the embodiments of the present disclosure are implemented bysoftware, the aforementioned method may be implemented by a module(process or function) which performs the aforementioned function. Themodule may be stored in a memory and executed. by a processor. Thememory may be installed inside or outside the processor and may beconnected to the processor via various well-known means. The processormay include Application-Specific Integrated Circuit (ASIC), otherchipsets, a logical circuit, and/or a data processing device. The memorymay include a Read-Only Memory (ROM), a Random Access Memory (RAM),aflash memory, a memory card, a storage medium, and/or other storagedevice. In other words, the embodiments according to the presentdisclosure may be implemented and executed on a processor, amicro-processor, a controller, or a chip. For example, functional unitsillustrated in the respective figures may be implemented and executed ona computer, a processor, a microprocessor, a controller, or a chip. Inthis case, information on implementation (for example, information oninstructions) or algorithms may be stored in a digital storage medium.

In addition, the decoding apparatus and the encoding apparatus to whichthe embodiment(s) of the present document is applied may be included ina multimedia broadcasting transceiver, a mobile communication terminal,a home cinema video device, a digital cinema video device, asurveillance camera, a video chat device, and a real time communicationdevice such as video communication, a mobile streaming device, a storagemedium, a camcorder, a video on demand (VoD) service provider, an OverThe Top (OTT) video device, an interne streaming service provider, a 3Dvideo device, a Virtual Reality (VR) device, an Augment Reality (AR)device, an image telephone video device, a vehicle terminal (forexample, a vehicle (including an autonomous vehicle) terminal, anairplane terminal, or a ship terminal), and a medical video device; andmay be used to process an image signal or data. For example, the OTTvideo device may include a game console, a Blu-ray player, anInternet-connected TV, a home theater system, a smartphone, a tablet PC,and a Digital Video Recorder (DVR).

In addition, the processing method to which the embodiment(s) of thepresent document is applied may be produced in the form of a programexecuted by a computer and may be stored in a computer-readablerecording medium. Multimedia data having a data structure according tothe embodiment(s) of the present document may also be stored in thecomputer-readable recording medium. The computer readable recordingmedium includes all kinds of storage devices and distributed storagedevices in Which computer readable data is stored. The computer-readablerecording medium may include, for example, a Blu-ray disc (BD), auniversal serial bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, aCD-ROM, a magnetic tape, a floppy disk, and an optical data storagedevice. The computer-readable recording medium also includes mediaembodied in the form of a carrier wave (for example, transmission overthe Internet), In addition, a bitstream generated by the encoding methodmay be stored in the computer-readable recording medium or transmittedthrough a wired or wireless communication network.

In addition, the embodiment(s) of the present document may be embodiedas a computer program product based on a program code, and the programcode may be executed on a computer according to the embodiment(s) of thepresent document. The program code may be stored on a computer-readablecarrier.

FIG. 13 illustrates an example of a content streaming system to whichembodiments disclosed in the present document are applicable.

Referring to FIG. 13 , the content streaming system to which embodimentsdisclosed in the present document are applicable may generally includean encoding server, a streaming server, a web server, a media storage, auser device, and a multimedia input device.

The encoding server functions to compress to digital data the contentsinput from the multimedia input devices, such as the smart phone, thecamera, the camcorder and the like, to generate a bitstream, and totransmittransamt it to the streaming server. As another example, in acase where the multimedia input device, such as, the smart phone, thecamera, the camcorder or the like, directly generates a bitstream, theencoding server may be omitted.

The bitstream may be generated by an encoding method or a bitstreamgeneration method to which the embodiments of the present document isapplied. And the streaming server may temporarily store the bitstream ina process of transmitting or receiving the bitstream.

The streaming server transmits multimedia data to the user equipment onthe basis of a user's request through the web server, which functions asan instrument that informs a user of what service there is. When theuser requests a service which the user wants, the web server transfersthe request to the streaming server, and the streaming server transmitsmultimedia data to the user. In this regard, the contents streamingsystem may include a separate control server, and in this case, thecontrol server functions to control commands/responses betweenrespective equipment in the content streaming system.

The streaming server may receive contents from the media storage and/orthe encoding server. For example, in a case the contents are receivedfrom the encoding server, the contents may be received in real time. Inthis case, the streaming server may store the bitstream for apredetermined period of time to provide the streaming service smoothly.

For example, the user equipment may include a mobile phone, a smartphone, a laptop computer, a digital broadcasting terminal, a personaldigital assistant (PDA), a portable multimedia player (PMP), anavigation, a slate PC, a tablet PC, an ultrabook, a wearable device(e.g., a watch-type terminal (smart watch), a. glass-type terminal(smart glass), a head mounted display (HMD)), a digital TV, a desktopcomputer, a digital signage or the like.

Each of servers in the contents streaming system may be operated as adistributed server, and in this case, data received by each server maybe processed in distributed manner.

Claims in the present description can be combined in a various way. Forexample, technical features in method claims of the present descriptioncan be combined to be implemented or performed in an apparatus, andtechnical features in apparatus claims can be combined to be implementedor performed in a method. Further, technical features in method claim(s)and apparatus claim(s) can be combined to be implemented or performed inan apparatus. Further, technical features in method claim(s) andapparatus claim(s) can be combined to be implemented or performed in amethod.

What is claimed is:
 1. An image decoding method performed by a decodingapparatus, the method comprising: obtaining image information includingmultiple transform selection (MTS) index and residual information from abitstream; deriving quantized transform coefficients for a current blockbased on the residual information, deriving transform coefficients forthe current block by performing a dequantization on the quantizedtransform coefficients; and generating residual samples of the currentblock by performing an inverse transform on the transform coefficientsbased on a transform kernel set related to the MTS index, wherein theMTS index represents the transform kernel set to be applied to thecurrent block among transform kernel set candidates; wherein bins of abin string of the MTS index are derived based on context coding, thecontext coding being performed based on values of context indexincrement for the bins of the bin string of the MTS index, wherein thebins of the bin string of the MTS index include first, second, third,and fourth bins, and wherein a value of the context index increment forthe first bin is fixed to 0, a value of the context index increment forthe second bin is fixed to 1, a value of the context index increment forthe third bin is fixed to 2, and a value of the context index incrementfor the fourth bin is fixed to
 3. 2. An image encoding method performedby an encoding apparatus, the method comprising: deriving residualsamples for a current block; deriving transform coefficients for thecurrent block by performing a transform on the residual samples based ona transform kernel set; deriving quantized transform coefficients bperforming a quantization on the transform coefficients; generatingmultiple transform selection (MTS) index related to the transform kernelse and residual information related to the quantized transformcoefficients; and encoding image information including the MTS index andthe residual information to output a bitstream, wherein the MTS indexrepresents the transform kernel set to be applied to the current blockamong transform kernel set candidates. wherein bins of a bin string ofthe MTS index are represented based on context coding, the contextcoding being performed based on values of context index increment forthe bins of the bin string of the MTS index, wherein the bins of the binstring of the MTS index include first, second, third, and fourth bins,and wherein a value of the context index increment for the first bin isfixed to 0, a value of the context index increment for the second bin isfixed to 1, a value of the context index increment for the third bin isfixed to 2, and a value of the context index increment for the fourthbin is fixed to
 3. 3. A non-transitory computer-readable digital storagemedium storing the bitstream generated by the image encoding method ofclaim
 2. 4. A transmission method of data for an image, the methodcomprising: obtaining a bitstream for the image, the bitstream isgenerated based on deriving residual samples for a current block,deriving transform coefficients for the current block by performing atransform on the residual samples based on a transform kernel set,deriving quantized transform coefficients by performing a quantizationon the transform coefficients, generating multiple transform selection(MTS) index related to the transform kernel set and residual informationrelated to the quantized transform coefficients, and encoding imageinformation including the MTS index and the residual information tooutput a bitstream; transmit the data comprising the bitstream for theimage, wherein the MTS index represents the transform kernel set to beapplied to the current block among transform kernel set candidates,wherein bins of a bin string of the MTS index are represented based oncontext coding, the context coding being performed based on values ofcontext index increment for the bins of the bin string of the MTS index,wherein the bins of the bin string of the MTS index include first,second, third, and fourth bins, and wherein a value of the context indexincrement for the first bin is fixed to 0, a value of the context indexincrement for the second bin is fixed to 1, a value of the context indexincrement for the third bin is fixed to 2, and a value of the contextindex increment for the fourth bin is fixed to 3.